import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
    {
        path: '/',
        redirect: '/taskList',
        // component: () => import(''),
    },
    {
        path: '/auth',
        name: 'auth',
        component: () => import('../views/auth.vue'),
        // meta: {
        //     keepAlive: false // 不需要被缓存
        //   }
    },
    {
        path: '/home',
        name: 'home',
        component: HomeView,
        // meta: {
        //   keepAlive: true // 需要缓存
        // }
    },
    {
        path: '/taskList',
        name: 'taskList',
        component: () => import('../views/taskList/index.vue')
    },
    {
        path: '/taskDetail',
        name: 'taskDetail',
        component: () => import('../views/taskDetail/index.vue')
    },
    {
        path: '/taskAdd',
        name: 'taskAdd',
        component: () => import('../views/taskList/taskAdd.vue'),
        meta: {
            keepAlive: false
        }
    },
    {
        path: '/selectPeople',
        name: 'selectPeople',
        component: () => import('../views/selectPeople/index.vue')
    },
    {
        path: '/cesi',
        name: 'cesi',
        component: () => import('../views/cesi.vue')
    }

]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})




export default router